\(\int (f+\frac {g}{x})^2 x^2 (a+b \log (c (d+e x)^n)) \, dx\) [304]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 120 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f} \]

[Out]

-1/3*b*(d*f-e*g)^2*n*x/e^2+1/6*b*(d*f-e*g)*n*(f*x+g)^2/e/f-1/9*b*n*(f*x+g)^3/f+1/3*b*(d*f-e*g)^3*n*ln(e*x+d)/e
^3/f+1/3*(f*x+g)^3*(a+b*ln(c*(e*x+d)^n))/f

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 45} \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {(f x+g)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}+\frac {b n (d f-e g)^3 \log (d+e x)}{3 e^3 f}-\frac {b n x (d f-e g)^2}{3 e^2}+\frac {b n (f x+g)^2 (d f-e g)}{6 e f}-\frac {b n (f x+g)^3}{9 f} \]

[In]

Int[(f + g/x)^2*x^2*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

-1/3*(b*(d*f - e*g)^2*n*x)/e^2 + (b*(d*f - e*g)*n*(g + f*x)^2)/(6*e*f) - (b*n*(g + f*x)^3)/(9*f) + (b*(d*f - e
*g)^3*n*Log[d + e*x])/(3*e^3*f) + ((g + f*x)^3*(a + b*Log[c*(d + e*x)^n]))/(3*f)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2459

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rubi steps \begin{align*} \text {integral}& = \int (g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx \\ & = \frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \frac {(g+f x)^3}{d+e x} \, dx}{3 f} \\ & = \frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \left (\frac {f (-d f+e g)^2}{e^3}+\frac {(-d f+e g)^3}{e^3 (d+e x)}+\frac {f (-d f+e g) (g+f x)}{e^2}+\frac {f (g+f x)^2}{e}\right ) \, dx}{3 f} \\ & = -\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.25 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {6 b d^2 f (d f-3 e g) n \log (d+e x)+e \left (x \left (6 a e^2 \left (3 g^2+3 f g x+f^2 x^2\right )-b n \left (6 d^2 f^2-3 d e f (6 g+f x)+e^2 \left (18 g^2+9 f g x+2 f^2 x^2\right )\right )\right )+6 b e \left (3 d g^2+e x \left (3 g^2+3 f g x+f^2 x^2\right )\right ) \log \left (c (d+e x)^n\right )\right )}{18 e^3} \]

[In]

Integrate[(f + g/x)^2*x^2*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(6*b*d^2*f*(d*f - 3*e*g)*n*Log[d + e*x] + e*(x*(6*a*e^2*(3*g^2 + 3*f*g*x + f^2*x^2) - b*n*(6*d^2*f^2 - 3*d*e*f
*(6*g + f*x) + e^2*(18*g^2 + 9*f*g*x + 2*f^2*x^2))) + 6*b*e*(3*d*g^2 + e*x*(3*g^2 + 3*f*g*x + f^2*x^2))*Log[c*
(d + e*x)^n]))/(18*e^3)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(264\) vs. \(2(110)=220\).

Time = 0.46 (sec) , antiderivative size = 265, normalized size of antiderivative = 2.21

method result size
parallelrisch \(\frac {6 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} f^{2}-2 x^{3} b d \,e^{3} f^{2} n +6 x^{3} a d \,e^{3} f^{2}+18 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} f g +3 x^{2} b \,d^{2} e^{2} f^{2} n -9 x^{2} b d \,e^{3} f g n +6 \ln \left (e x +d \right ) b \,d^{4} f^{2} n -18 \ln \left (e x +d \right ) b \,d^{3} e f g n +36 \ln \left (e x +d \right ) b \,d^{2} e^{2} g^{2} n +18 x^{2} a d \,e^{3} f g +18 x \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{3} g^{2}-6 x b \,d^{3} e \,f^{2} n +18 x b \,d^{2} e^{2} f g n -18 x b d \,e^{3} g^{2} n +18 x a d \,e^{3} g^{2}-18 \ln \left (c \left (e x +d \right )^{n}\right ) b \,d^{2} e^{2} g^{2}}{18 d \,e^{3}}\) \(265\)
risch \(-\frac {f \ln \left (e x +d \right ) b \,d^{2} g n}{e^{2}}-\frac {f b g n \,x^{2}}{2}-\frac {f^{2} b \,d^{2} n x}{3 e^{2}}+\frac {f^{2} \ln \left (e x +d \right ) b \,d^{3} n}{3 e^{3}}-\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{6}+\frac {a \,f^{2} x^{3}}{3}+a \,g^{2} x +\ln \left (c \right ) b \,g^{2} x +\frac {f^{2} \ln \left (c \right ) b \,x^{3}}{3}-\frac {i \pi b \,g^{2} x \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}-b \,g^{2} n x +\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}+\frac {b \,g^{2} n d \ln \left (e x +d \right )}{e}+\frac {\left (f x +g \right )^{3} b \ln \left (\left (e x +d \right )^{n}\right )}{3 f}-\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}+\frac {f^{2} b d n \,x^{2}}{6 e}-\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{6}+\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {f^{2} b n \,x^{3}}{9}+f a g \,x^{2}-\frac {\ln \left (e x +d \right ) b \,g^{3} n}{3 f}+f \ln \left (c \right ) b g \,x^{2}-\frac {i f \pi b g \,x^{2} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {f x b d n g}{e}+\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b \,g^{2} x \,\operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i f^{2} \pi b \,x^{3} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}\) \(585\)

[In]

int((f+g/x)^2*x^2*(a+b*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

1/18*(6*x^3*ln(c*(e*x+d)^n)*b*d*e^3*f^2-2*x^3*b*d*e^3*f^2*n+6*x^3*a*d*e^3*f^2+18*x^2*ln(c*(e*x+d)^n)*b*d*e^3*f
*g+3*x^2*b*d^2*e^2*f^2*n-9*x^2*b*d*e^3*f*g*n+6*ln(e*x+d)*b*d^4*f^2*n-18*ln(e*x+d)*b*d^3*e*f*g*n+36*ln(e*x+d)*b
*d^2*e^2*g^2*n+18*x^2*a*d*e^3*f*g+18*x*ln(c*(e*x+d)^n)*b*d*e^3*g^2-6*x*b*d^3*e*f^2*n+18*x*b*d^2*e^2*f*g*n-18*x
*b*d*e^3*g^2*n+18*x*a*d*e^3*g^2-18*ln(c*(e*x+d)^n)*b*d^2*e^2*g^2)/d/e^3

Fricas [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.82 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-\frac {2 \, {\left (b e^{3} f^{2} n - 3 \, a e^{3} f^{2}\right )} x^{3} - 3 \, {\left (6 \, a e^{3} f g + {\left (b d e^{2} f^{2} - 3 \, b e^{3} f g\right )} n\right )} x^{2} - 6 \, {\left (3 \, a e^{3} g^{2} - {\left (b d^{2} e f^{2} - 3 \, b d e^{2} f g + 3 \, b e^{3} g^{2}\right )} n\right )} x - 6 \, {\left (b e^{3} f^{2} n x^{3} + 3 \, b e^{3} f g n x^{2} + 3 \, b e^{3} g^{2} n x + {\left (b d^{3} f^{2} - 3 \, b d^{2} e f g + 3 \, b d e^{2} g^{2}\right )} n\right )} \log \left (e x + d\right ) - 6 \, {\left (b e^{3} f^{2} x^{3} + 3 \, b e^{3} f g x^{2} + 3 \, b e^{3} g^{2} x\right )} \log \left (c\right )}{18 \, e^{3}} \]

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

-1/18*(2*(b*e^3*f^2*n - 3*a*e^3*f^2)*x^3 - 3*(6*a*e^3*f*g + (b*d*e^2*f^2 - 3*b*e^3*f*g)*n)*x^2 - 6*(3*a*e^3*g^
2 - (b*d^2*e*f^2 - 3*b*d*e^2*f*g + 3*b*e^3*g^2)*n)*x - 6*(b*e^3*f^2*n*x^3 + 3*b*e^3*f*g*n*x^2 + 3*b*e^3*g^2*n*
x + (b*d^3*f^2 - 3*b*d^2*e*f*g + 3*b*d*e^2*g^2)*n)*log(e*x + d) - 6*(b*e^3*f^2*x^3 + 3*b*e^3*f*g*x^2 + 3*b*e^3
*g^2*x)*log(c))/e^3

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (102) = 204\).

Time = 4.50 (sec) , antiderivative size = 252, normalized size of antiderivative = 2.10 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\begin {cases} \frac {a f^{2} x^{3}}{3} + a f g x^{2} + a g^{2} x + \frac {b d^{3} f^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {b d^{2} f^{2} n x}{3 e^{2}} - \frac {b d^{2} f g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} + \frac {b d f^{2} n x^{2}}{6 e} + \frac {b d f g n x}{e} + \frac {b d g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f^{2} n x^{3}}{9} + \frac {b f^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} - \frac {b f g n x^{2}}{2} + b f g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} - b g^{2} n x + b g^{2} x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f^{2} x^{3}}{3} + f g x^{2} + g^{2} x\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((f+g/x)**2*x**2*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f**2*x**3/3 + a*f*g*x**2 + a*g**2*x + b*d**3*f**2*log(c*(d + e*x)**n)/(3*e**3) - b*d**2*f**2*n*x/
(3*e**2) - b*d**2*f*g*log(c*(d + e*x)**n)/e**2 + b*d*f**2*n*x**2/(6*e) + b*d*f*g*n*x/e + b*d*g**2*log(c*(d + e
*x)**n)/e - b*f**2*n*x**3/9 + b*f**2*x**3*log(c*(d + e*x)**n)/3 - b*f*g*n*x**2/2 + b*f*g*x**2*log(c*(d + e*x)*
*n) - b*g**2*n*x + b*g**2*x*log(c*(d + e*x)**n), Ne(e, 0)), ((a + b*log(c*d**n))*(f**2*x**3/3 + f*g*x**2 + g**
2*x), True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.56 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {1}{3} \, b f^{2} x^{3} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {1}{3} \, a f^{2} x^{3} - b e g^{2} n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} + \frac {1}{18} \, b e f^{2} n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} - \frac {1}{2} \, b e f g n {\left (\frac {2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac {e x^{2} - 2 \, d x}{e^{2}}\right )} + b f g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + a f g x^{2} + b g^{2} x \log \left ({\left (e x + d\right )}^{n} c\right ) + a g^{2} x \]

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

1/3*b*f^2*x^3*log((e*x + d)^n*c) + 1/3*a*f^2*x^3 - b*e*g^2*n*(x/e - d*log(e*x + d)/e^2) + 1/18*b*e*f^2*n*(6*d^
3*log(e*x + d)/e^4 - (2*e^2*x^3 - 3*d*e*x^2 + 6*d^2*x)/e^3) - 1/2*b*e*f*g*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 -
 2*d*x)/e^2) + b*f*g*x^2*log((e*x + d)^n*c) + a*f*g*x^2 + b*g^2*x*log((e*x + d)^n*c) + a*g^2*x

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 424 vs. \(2 (110) = 220\).

Time = 0.31 (sec) , antiderivative size = 424, normalized size of antiderivative = 3.53 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {{\left (e x + d\right )}^{3} b f^{2} n \log \left (e x + d\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f^{2} n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f^{2} n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{2} b f g n \log \left (e x + d\right )}{e^{2}} - \frac {2 \, {\left (e x + d\right )} b d f g n \log \left (e x + d\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g^{2} n \log \left (e x + d\right )}{e} - \frac {{\left (e x + d\right )}^{3} b f^{2} n}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} b d f^{2} n}{2 \, e^{3}} - \frac {{\left (e x + d\right )} b d^{2} f^{2} n}{e^{3}} - \frac {{\left (e x + d\right )}^{2} b f g n}{2 \, e^{2}} + \frac {2 \, {\left (e x + d\right )} b d f g n}{e^{2}} - \frac {{\left (e x + d\right )} b g^{2} n}{e} + \frac {{\left (e x + d\right )}^{3} b f^{2} \log \left (c\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f^{2} \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f^{2} \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{2} b f g \log \left (c\right )}{e^{2}} - \frac {2 \, {\left (e x + d\right )} b d f g \log \left (c\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g^{2} \log \left (c\right )}{e} + \frac {{\left (e x + d\right )}^{3} a f^{2}}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} a d f^{2}}{e^{3}} + \frac {{\left (e x + d\right )} a d^{2} f^{2}}{e^{3}} + \frac {{\left (e x + d\right )}^{2} a f g}{e^{2}} - \frac {2 \, {\left (e x + d\right )} a d f g}{e^{2}} + \frac {{\left (e x + d\right )} a g^{2}}{e} \]

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/3*(e*x + d)^3*b*f^2*n*log(e*x + d)/e^3 - (e*x + d)^2*b*d*f^2*n*log(e*x + d)/e^3 + (e*x + d)*b*d^2*f^2*n*log(
e*x + d)/e^3 + (e*x + d)^2*b*f*g*n*log(e*x + d)/e^2 - 2*(e*x + d)*b*d*f*g*n*log(e*x + d)/e^2 + (e*x + d)*b*g^2
*n*log(e*x + d)/e - 1/9*(e*x + d)^3*b*f^2*n/e^3 + 1/2*(e*x + d)^2*b*d*f^2*n/e^3 - (e*x + d)*b*d^2*f^2*n/e^3 -
1/2*(e*x + d)^2*b*f*g*n/e^2 + 2*(e*x + d)*b*d*f*g*n/e^2 - (e*x + d)*b*g^2*n/e + 1/3*(e*x + d)^3*b*f^2*log(c)/e
^3 - (e*x + d)^2*b*d*f^2*log(c)/e^3 + (e*x + d)*b*d^2*f^2*log(c)/e^3 + (e*x + d)^2*b*f*g*log(c)/e^2 - 2*(e*x +
 d)*b*d*f*g*log(c)/e^2 + (e*x + d)*b*g^2*log(c)/e + 1/3*(e*x + d)^3*a*f^2/e^3 - (e*x + d)^2*a*d*f^2/e^3 + (e*x
 + d)*a*d^2*f^2/e^3 + (e*x + d)^2*a*f*g/e^2 - 2*(e*x + d)*a*d*f*g/e^2 + (e*x + d)*a*g^2/e

Mupad [B] (verification not implemented)

Time = 1.29 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.77 \[ \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=x^2\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{2\,e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{6\,e}\right )+x\,\left (\frac {3\,a\,e\,g^2-3\,b\,e\,g^2\,n+6\,a\,d\,f\,g}{3\,e}-\frac {d\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{3\,e}\right )}{e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f^2\,x^3}{3}+b\,f\,g\,x^2+b\,g^2\,x\right )+\frac {f^2\,x^3\,\left (3\,a-b\,n\right )}{9}+\frac {\ln \left (d+e\,x\right )\,\left (b\,n\,d^3\,f^2-3\,b\,n\,d^2\,e\,f\,g+3\,b\,n\,d\,e^2\,g^2\right )}{3\,e^3} \]

[In]

int(x^2*(f + g/x)^2*(a + b*log(c*(d + e*x)^n)),x)

[Out]

x^2*((f*(a*d*f + 2*a*e*g - b*e*g*n))/(2*e) - (d*f^2*(3*a - b*n))/(6*e)) + x*((3*a*e*g^2 - 3*b*e*g^2*n + 6*a*d*
f*g)/(3*e) - (d*((f*(a*d*f + 2*a*e*g - b*e*g*n))/e - (d*f^2*(3*a - b*n))/(3*e)))/e) + log(c*(d + e*x)^n)*((b*f
^2*x^3)/3 + b*g^2*x + b*f*g*x^2) + (f^2*x^3*(3*a - b*n))/9 + (log(d + e*x)*(b*d^3*f^2*n + 3*b*d*e^2*g^2*n - 3*
b*d^2*e*f*g*n))/(3*e^3)